package etcd

import (
	"errors"
	"time"
)

var (
	ErrValueMayChanged = errors.New("The value has been changed by others on this time.")
)

type KvEvtType int

type KvEvtSrc int

const (
	KvEventNew    = KvEvtType(0)
	KvEventUpdate = KvEvtType(1)
	KvEventDelete = KvEvtType(2)
)

// kv事件

type KvEvt struct {
	Src   KvEvtSrc
	Type  KvEvtType
	Key   string
	Value []byte
	ExVal interface{}
}

type EtcdConfig struct {
	Addrs             []string      `yaml:"addr"`
	UserName          string        `yaml:"username"`
	Password          string        `yaml:"password"`
	token             string        `yaml:"token"`
	ConnectionTimeout time.Duration `yaml:"connection_timeout"`
}
